home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 4 / MacMania 4.toast / / Multimedia & Desktop / gst-tghost-demo / Torquemada Explained / Torquemanual < prev    next >
Text File  |  1994-03-28  |  85KB  |  1,957 lines

  1.  
  2.  
  3.  
  4.  
  5. A Torquemanual for the Inquisitive
  6.  
  7.  
  8.  
  9.  
  10. Documenting Torquemada version 1.3.0, © 1994 by Greg Swann
  11.  
  12. 03/28/94
  13.  
  14.  
  15. Greg Swann
  16.  
  17. CompuServe: 70640,1574
  18.  
  19. P.O. Box 1724        or    3417 North Pleasant Drive
  20. Andover, MA 01810          Chandler, AZ 85224
  21.  
  22.  
  23.  
  24.  
  25. Table of Contents
  26.  
  27. 0. Introductory Chatter
  28.  
  29. 1. Torquemada Basics
  30.  
  31. 2. String Literals
  32.  
  33. 3. Aliases
  34.  
  35. 4. Case Conversion
  36.  
  37. 5. Untyped Wildcards
  38.  
  39. 6. Typed Wildcards
  40.  
  41. 7. The Do-It-Yourself Wildcard
  42.  
  43. 8. Wildstrings
  44.  
  45. 9. The Wildstring Modifier
  46.  
  47. 10. Torquemada's Ghost
  48.  
  49. 11. Putting It All Together
  50.  
  51. 12. Bringing It All Back Home
  52.  
  53.  
  54.  
  55. 0. Introductory Chatter
  56.  
  57. This is kind of a funny little Ugly Duckling story. Torquemada the
  58. Inquisitor started life as a fluffy little bit of nothingstuff with a
  59. Mac interface wrapped around it. When we were testing XP8, Garry
  60. Fairbairn (the Argus of Saskatoon) had asked me to come up with a
  61. search and replace engine that he could use to translate American
  62. spellings to those favored by people more recently divorced from the
  63. Crown. I came home one night and spent two minutes writing a little
  64. toy that traded massive quantities of memory for very, very fast
  65. searches. That little core was the basis of the first Torquemada.
  66.  
  67. Torquemada 1.0.0 worked only on string literals. It sported no
  68. wildcards. It read only only one line at a time. But it was very,
  69. very fast...
  70.  
  71. We've been through eleven versions since then. Along the way, the
  72. search engine has been replaced twice, making it somewhat slower but
  73. a lot less hungry for memory. The read/write code has been replaced
  74. three times. The interface has been (transparently) overhauled. And
  75. somewhere in there, I began to take it seriously... (grin)
  76.  
  77. The current release, version 1.3.0, can deploy a infinite number of
  78. search and replace strings on up to 256 files in a drag and drop
  79. batch, and the searches can employ up to 29 wildthings of various
  80. stripes ("wildthings" are Torquemada's multifaceted wildcards; there
  81. will be _much_ more about these in due course). And it is still very,
  82. very fast...
  83.  
  84. And this is very far from the end of the story. But it is the end for
  85. now, which makes this the appropriate place to fully document the
  86. software as it now stands. Torquemada will next surface in a
  87. full-blown word processor that is currently in the design stage. That
  88. product, "codenamed" (means _not_ named) MyEditor, will offer a great
  89. host of new features, but it will not be released for some while.
  90.  
  91.  
  92. Commercial, legal and other pertinent notices:
  93.  
  94. XP8, mentioned above, is a text file reformatter. It will clean up
  95. and make QuarkXPress-ready Macintosh or DOS text files. Among many
  96. other features, it intelligently reformats paragraphs, converts the
  97. DOS or WordStar character sets to their Mac equivalents,
  98. substantially improves the hyphenation and justification of text,
  99. converts quotes better than any software currently available, and
  100. traps for XPress Tags errors that might otherwise result in missing
  101. text or irreversible document corruption. A semi-inhibited shareware
  102. version of XP8 is available on CompuServe (GO DTPFORUM, Library 5)
  103. and other electronic information services. The full commercial
  104. release can be obtained from Greg Swann at:
  105.  
  106. P.O. Box 1724
  107. Andover, MA 01810
  108.  
  109. Licenses are sold per machine, with a single license costing $50;
  110. 2-10 licences are $45 each; and 11 or more licenses are $40 each.
  111.  
  112. Torquemada the Inquisitor, its source and executable code, and this
  113. poor excuse for a manual are Copyright (C) 1994 by Greg Swann. All
  114. rights are most emphatically reserved.
  115.  
  116. Torquemada is licensed for use on one machine by the person who paid
  117. for it. If you didn't pay for it, please do! I am one person, with a
  118. long-suffering family, not Conglomerated MegaSoft (not to imply that
  119. there's any virtue in ripping _them_ off!).
  120.  
  121. Torquemada is delivered "as is", without any warranties, expressed or
  122. implied. It is not warranted to be useful _to_ anyone, _for_
  123. anything, and in no wise am I to be held responsible for any
  124. unfortunate consequences resulting from its use or misuse. And I
  125. _hate_ having to say things like that. I do my best to write useful,
  126. simple, elegant, bug-free solutions to difficult problems. If you
  127. take it into your head that I represent your big chance to 'strike it
  128. rich,' you will pay a lot in legal fees to discover that you have
  129. miscalculated. It's sad and sick and stupid that we live in a world
  130. of bloodsuckers, but I _promise_ I will not be leech lunch. So there!
  131.  
  132. And: to those to whom the above disclaimer does not apply: forgive me
  133. for having to make it. It's _you_ whom I'm working for, for pay or
  134. for free. I appreciate your custom and your support, and I wish we
  135. all could just comb the others out of our hair...
  136.  
  137. (Hey, it's a real 'personal' software company! (grin))
  138.  
  139.  
  140. Some notes at random:
  141.  
  142. While XP8 is a QuarkXPress-specific program, Torquemada can be used
  143. with any Macintosh software that can read and write files of type
  144. TEXT (plain text files). For that reason, this manual is produced as
  145. a plain text file. I would much prefer to write it as an XPress file,
  146. but that wouldn't be terribly useful to people using PageMaker,
  147. ReadySetGo! or FrameMaker. For ease of use with a variety of text
  148. editors, this file is produced in DOS-like fashion; each line ends
  149. with a carriage return. Ideally, you should read it and print it out
  150. in a monospaced font such as Courier, since in certain places things
  151. are aligned with spaces. And: where a certain keystroke might be
  152. ambiguous, I am naming it in words enclosed in braces; for example,
  153. {space} means the spacebar character.
  154.  
  155. In the same neighborhood, because I myself am an XPress user, and
  156. because my own uses for Torquemada are focused on Quark, my examples
  157. tend to be intensely Quark-like. This is a side-effect that will have
  158. to be overcome by users of other software. Reasoning by analogy, you
  159. will be able to see how to apply my examples to similar features in
  160. your software of choice.
  161.  
  162. To make the best use of this software (and of XP8, for that matter),
  163. you need some type of fairly functional text editor/word processor. I
  164. use Word or BBEdit, a freeware programmer's editor. The latter is
  165. highly recommended for our purposes.
  166.  
  167. As mentioned above, Torquemada owes its origins to some exceptionally
  168. literate caterwauling by Garry Fairbairn. Its further development was
  169. goaded in good measure by some very compelling growling by Shane
  170. Stanley (who has a unique perspective on things due to his insistence
  171. on living upside down in an entirely different day). Along the way, a
  172. number of other users made valid, valuable suggestions, and I'm sure
  173. that will continue to be the case. More than any other piece of
  174. software by me, Torquemada has been influenced by its users, and,
  175. here, at the outset, I want to encourage you to contact me with any
  176. requests or suggestions you have.
  177.  
  178. The default "Torquemada Prefs" file shipped with this disk pays
  179. homage to the 20 brave souls who lent their diligence and
  180. intelligence to the XP8 beta-testing process. Despite my gentle
  181. ribbing, they have my gratitude and my highest respect.
  182.  
  183. Mike Arst (inventor of the Kvetchamatic Irregular Expression Parser)
  184. had a profound and lasting impact on this document. Obviously, any
  185. remaining errors or ambiguities are my responsibility; he takes
  186. credit only for the stuff that is clear, grammatically correct, and
  187. spelled properly in languages currently in use by humans. Seriously:
  188. he has a rare talent for inducing a tabula rasa mental state (this
  189. may not be a compliment!), such that he can spot hand-waving or other
  190. logical elisions better than anyone I know. It was he who forced me
  191. to write the (to me tedious) descriptions of what each and every
  192. command means. If you are a software developer, you are well-advised
  193. to pay Mike whatever he asks to critique your documentation. He can
  194. be reached on CompuServe at 70403,1337 or by USPS at:
  195.  
  196. Mike Arst
  197. 2459 Fifth Avenue West
  198. Seattle, WA 98119-2506
  199.  
  200. Perhaps because of its democratic roots (how odd for a program named
  201. after an autocrat), Torquemada the Inquisitor has sprouted a great
  202. host of nicknames. I tend to call things by (quasi-)acronym, so he's
  203. TQM to me. From the very beginning he was Torque or Tork to others,
  204. and these gave rise to verb forms: I Torque, you were Torking, they
  205. had Torqued.
  206.  
  207. And, for reference: Tomas de Torquemada was the First Grand
  208. Inquisitor of the Spanish Inquisition. The name was later adopted as
  209. a nom de guerre by the first editor of the Sunday Times of London
  210. Crossword Puzzle, and I probably would not have used it were it not
  211. for that latter association.
  212.  
  213.  
  214.  
  215. 1. Torquemada Basics
  216.  
  217. Torquemada is: 32-bit clean, System 7 compatible, Multi-Finder eager,
  218. kind to children and house pets, and safe for use
  219. on your precious hardwood floors. The companion software, Torquemada's
  220. Ghost, is AppleEvent aware and is designed specifically to be used with
  221. AppleScript or Frontier scripts.
  222.  
  223. Torquemada will run on any Mac from the Plus up. It requires 768K of
  224. RAM, and you are cautioned not to set the partition smaller than
  225. this; we're using it all.
  226.  
  227. The interface consists of two dialog boxes and two help windows, and
  228. all of these are very straightforward in operation. If you can use a
  229. Mac at all, you can use my boy Torque.
  230.  
  231. The Pyre of Purification dialog box uses 10 point Helvetica. If you
  232. don't have that bitmap loaded, you will need to load it into either
  233. your System file or your Core Fonts suitcase. If you don't,
  234. Torquemada will still work, but the search and replace strings will
  235. be hard to read.
  236.  
  237. And: when your files are being processed, Torque displays the stylish
  238. and attractive Movado Museum Watch Cursor to let you know that things
  239. are really happening.
  240.  
  241. TQM reads files of type 'TEXT'. It will also see files with the
  242. creator types 'text', 'MDOS', 'mdos', 'CRLF' and 'crlf'. These latter
  243. types are supported because some third-party products have very odd
  244. ideas about how to treat 'TEXT' files.
  245.  
  246. Torquemada writes files of type 'TEXT' (with the creator type
  247. 'XP84'). These files can be opened from any application that can read
  248. plain text files. They can be processed directly by XP8 or other
  249. utilities of mine. Or they can be imported directly into QuarkXPress,
  250. PageMaker or any other publishing application with a plain- or
  251. smart-ASCII filter.
  252.  
  253. You write your search and replace strings into the Pyre of
  254. Purification dialog box. Searches go on the left and replaces on the
  255. right. Space is allotted for up to 20 search and replace strings, and
  256. precious little space is left on a nine-inch screen! Torquemada
  257. search and replace strings have an enormous maximum length (254
  258. characters). The normal Macintosh text editing services are available
  259. in the Pyre, along with Select All, Copy, Cut, Paste and Clear. You
  260. can Copy from your text editor and Paste into the Pyre, which is the
  261. fastest way to write search strings.
  262.  
  263. The Inquisitor reads and writes sets of search and replace strings.
  264. This is valuable: in many cases, you need to perform the same searches
  265. on the same types of files, week in and week out. Once you have
  266. perfected a set of searches, you can save it for reuse. Through the
  267. Open Set button in the Pyre of Purification dialog box, Torquemada
  268. will read set files having the creator type 'PREF'. It will also 'see'
  269. the types 'pref', 'TEXT', 'text', 'CRLF' and 'crlf'. These latter
  270. types are supported so that, if you want, you can write sets in your
  271. word processor. A TQM set saved from the Pyre of Purification consists
  272. of 40 plain text lines in the form of search, replace, search,
  273. replace, etc. When you hit the Save Set button in the dialog, the
  274. software will write the currently active set to a file of type
  275. 'PREF'.
  276.  
  277. Note: if you don't intend to edit a set in the Pyre of Purification, it
  278. can have an infinite number of search and replace strings. Also, a set
  279. file can use any number of tabs as the delimiter between the search
  280. and replace string. The reason is to permit easy editing of set files
  281. in a text editor or word processor. Open the set file called "A Legal
  282. Set File" from a text editor or word processor to see how this looks
  283. in real life. Torquemada continues to Save sets using CR as the
  284. delimiter. Be careful Pasting into WP docs; TQM filters tabs and
  285. returns before he saves, but you'll need to do this manually after you
  286. Paste. The Pyre of Purification will only edit files consisting of 20
  287. search and replace strings. If you attempt to edit a set containing
  288. more than 20 pairs of strings, you will get an ALRT inviting you to
  289. Cancel! or Truncate the set.
  290.  
  291. If you have one basic set of searches that you frequently need to
  292. run, you can save it under the name "Torquemada Prefs" and store it
  293. in the same folder where TQM resides. When you launch the software
  294. directly, this set will load automatically.
  295.  
  296. Alternatively, you can launch Torquemada by double-clicking on a set,
  297. by selecting it and doing a Finder Open, or (under System 7) by
  298. dragging the set onto the application's icon or an alias of it.
  299. Torque will launch and the set you selected will be loaded instead of
  300. Torquemada Prefs. For this to work, the set must have the creator
  301. type 'PREF'.
  302.  
  303. You can select up to 32 sets (of type 'PREF') in this fashion, and the
  304. sets will be processed in alphabetical order on your text files. These
  305. sets will persist until you either Quit, Open Set, Save Set or Clear
  306. All. After you do any of the latter three, only the set visible in the
  307. Pyre of Purification will be run on your text.
  308.  
  309. IMPORTANT: Torquemada's Ghost processes set files in the order
  310. received, not in alphabetical order. See the section on Torquemada's
  311. Ghost for a fuller discussion of this important difference.
  312.  
  313. Under System 7, you can select up to 256 text files and drag and drop
  314. them onto the application's icon or an alias of it. At the same time,
  315. you can drag and drop up to 32 sets (of type 'PREF'). If you do not
  316. select any sets, Torquemada Prefs will be run on your batch of files.
  317. If you do select one or more sets, those sets will be run in
  318. alphabetical order on each of your files.
  319.  
  320. To make this clear:
  321.  
  322. You can use the standard file interface to Open Sets and Open and
  323. Save files; or,
  324.  
  325. You can select a number of sets in the finder and use the standard
  326. file interface to have those sets run in alphabetical order on each
  327. file Opened; or,
  328.  
  329. Under System 7, you can select a number of sets and a number of files
  330. and drag and drop them all on Torque. Each file will be run against
  331. all the sets. 
  332.  
  333.  
  334. Not for nerds only:
  335.  
  336. 'Alphabetical order' is serious business. The 'natural' order is the
  337. order selected (clicked upon) in the Finder. That's hard to remember,
  338. and it's hard to predict the effects of multiple file selection done
  339. by dragging out a marquee. So: we're sorting to lexical order: A
  340. comes before Z, which comes before a, which comes before z. The files
  341. 'Today', 'TODAY', and 'today' would sort to:
  342.  
  343. TODAY
  344. Today
  345. today
  346.  
  347. O comes before o, and T comes before t. If you need to know how sets
  348. will sort, just look at an ASCII chart. Better yet, name your sets
  349. with numbers; use two digits (02, not 2), since 10 comes before 2.
  350.  
  351. Why are we sorting sets? A batch of sets is a 'virtual' set. The
  352. second search in a single set can operate on the results of the first
  353. search. In the same way, the first search in the second set of a
  354. batch can operate on something left behind by the first set. To use
  355. batches of sets reliably, you have to know the exact order in which
  356. the searches will be made. Sorting the sets gives you greater
  357. control.
  358.  
  359. REMEMBER: Torquemada's Ghost processes set files in the order received,
  360. not in alphabetical order.
  361.  
  362. Why are the file limits set so high? Because I hate to think that
  363. anything I do is _almost_ good enough. Honestly, if ever you find
  364. yourself running hundreds of searches, examine your methods to see if
  365. they can be made more general. If ever you find yourself running on a
  366. batch of 256 files, query your source to see if they can tighten up on
  367. their end a bit. But: if you really _do_ need awesome quantities of
  368. strings or files, you've got 'em.
  369.  
  370. Batch-processed files will have the default extension (.TQM) applied
  371. to them automatically. If a source file has already been Torqued, and
  372. if its name is _exactly_ 31 characters in length, the new name would
  373. be identical to the old. In that one case, we are using a slightly
  374. different extension (.TQµ), so as to avoid toasting the source file.
  375.  
  376. Logic of Beeps: if you run a batch of files, Torquemada will beep at
  377. you, a cheery little, "Hey, Dufus! Wake up!" TQM also beeps at the
  378. end of any _normal_ run that takes longer than 5 seconds.
  379.  
  380.  
  381. Nuts and bolts:
  382.  
  383. Torquemada reads and writes by the buffer-load. At read time, a
  384. buffer is approximately 16K in size, and space is allocated for a
  385. buffer to quadruple in size during processing. Torque can read around
  386. returns _because_ it is working on these enormous buffers. At the
  387. same time, we divide between buffers intelligently, so as to avoid
  388. missing any searches.
  389.  
  390. At the time that a new buffer is assembled, a check is run against
  391. the end of the buffer. If any of the search strings are present in
  392. the end of the buffer, the buffer is truncated at the start of the
  393. earliest full match. The remainder is prepended to the next buffer.
  394.  
  395. Each search string is run against the whole buffer _as it is at the
  396. time of the search._ Consequently, later searches can operate on the
  397. results of earlier replaces. This proves useful on a number of
  398. grounds, as we will see in due course. But it is also grounds for a
  399. certain amount of caution.
  400.  
  401. The buffer truncation mentioned above can only happen with strings
  402. that represent the literal contents of the source file at read time.
  403. So if a later search needs to find something put in by an earlier
  404. replace, that earlier search needs to include everything expected by
  405. the later search. As an example, this could fail ("^p" is a Torquemada
  406. 'alias' that denotes the carriage return character):
  407.  
  408. SEARCH STRING   REPLACE STRING
  409. -------------   --------------
  410. ^pGreg          ^p<B>Greg<B>
  411. ^p^p<B>Greg<B>  ^p^p<BI>Greg<BI>
  412.  
  413. It could fail because the first search doesn't require Torquemada to
  414. preserve both returns in the same buffer. In a very large file, with
  415. a large number of chances to fail, some few can slip through the
  416. cracks. The solution is simple: specify everything you'll need to see
  417. in search strings that reflect the actual contents of the file:
  418.  
  419. ^p^pGreg        ^p^p<B>Greg<B>
  420. ^p^p<B>Greg<B>  ^p^p<BI>Greg<BI>
  421.  
  422. Torquemada uses 29 characters in low ASCII for its own storage
  423. purposes; all of the various wildthings are flagged with these codes.
  424. In consequence, the software needs to insulate any low ASCII characters
  425. found in the source. Otherwise, they would look like wildthings during
  426. searches. So at read time, Torquemada is converting low ASCII found in
  427. the source to a relatively harmless form, e.g. <\#008>. ASCII 1 though
  428. 8, 11, 12, and 14 through 29 are handled this way.
  429.  
  430. ASCII 10 (the linefeed) is handled with a certain measure of
  431. intelligence. The linefeed is the poor relation among control
  432. characters. It had a great day in the sun on Unix systems, where its
  433. use is analogous to the carriage return on the Mac. On DOS systems,
  434. it is an entirely redundant siamese twin to the carriage return. And
  435. on Macs, the poor little linefeed isn't used at all. So: if
  436. Torquemada finds himself processing a Unix file, he will convert the
  437. linefeeds to carriage returns. Linefeeds in DOS files are thrown away
  438. with malice aforethought.
  439.  
  440. ASCII 9 and 13 (Tab and Return) are not converted.
  441.  
  442. ASCII 30 is used by Word to denote non-breaking words, so we're
  443. converting that to <\h>, the XPress Tags-language mnemonic for "don't
  444. hyphenate". And Word uses ASCII 31 for the non-breaking hyphen, so
  445. we're showing that as <\!#45>, XPress Tags for a non-breaking hyphen.
  446. All of these conversions happen before any searches are run, so you
  447. can search for the rare instance of low ASCII by using these codes.
  448.  
  449. On the way _out_ (as the new files is being written to disk) all
  450. instances of the QuarkXPress literal code XPress Tag (e.g., "<\#000>")
  451. will be converted to their actual ASCII value. This is implemented as
  452. a post-process (i.e., after all searches are complete), so it is
  453. possible to search for and act upon any tagged literal codes. Files
  454. processed in this way can be run through Torquemada again
  455. transparently, with the stipulations discussed above: ASCII 30 and 31
  456. are permanently converted to <\h> and <\#45>, and LF (ASCII 10) is
  457. always thrown away. If you introduce an LF into a file, be sure to
  458. reintroduce it in subsequent uses of Torquemada.
  459.  
  460.  
  461. User interface notes...
  462.  
  463. Torquemada 1.3.0 implements a number of new interface features. If
  464. you're new to the software, follow along. But if you're not, follow
  465. along _closely_. A _lot_ has changed.
  466.  
  467. First, when Torquemada is launched with a drag and drop batch of TEXT
  468. files, it will quit automatically at the end of the batch. Drag &
  469. drop batches of set files only will be handled as before, as will
  470. double-click launches.
  471.  
  472. All of Torquemada's menu commands and buttons can be accessed via
  473. keyboard equivalents. For example, the Wildcards scorecard can be had
  474. with CMD-? from either dialog.
  475.  
  476. Any window or dialog with a close box can be closed with CMD-W.
  477.  
  478. In the Pyre of Purification (Strings) dialog, CMD-S will do a Save of
  479. any _named_ file. If a file has not been named, that is, if the
  480. program was launched by a double-click on its icon, Torquemada will do
  481. a Save As instead. If you double-click on, drag and drop, or Open a
  482. set, that is the set that will be Saved, and its name will appear in
  483. the title bar of the dialog. If you double-click on or drag and drop
  484. multiple sets, as described above, the set Saved will be the first,
  485. lexically, and its name will be shown in the dialog. Note that when a
  486. set is Saved or altered by any means, the rest of the sets in the
  487. batch are forgotten about.
  488.  
  489. Important: the Save Set button works as before, when clicked upon. It
  490. does a Save As, warning you if you try to save under the same name.
  491.  
  492. Also important: you can do a Save As on a named set by typing
  493. CMD-OPT-S, a familiar enough keystroke. This is a quick way to create
  494. multiple variations on a general theme.
  495.  
  496. After an Open Set or a Save Set (of whatever stripe), the name of the
  497. currently opened set will be reflected in the dialog.
  498.  
  499. In the Pyre of Purification itself, we are showing the space character
  500. as "˙" (ASCII 250, OPT-h) and the OPT-space character as "˚" (ASCII
  501. 251, OPT-k). This is done to make them visible, and therefore
  502. _countable_. In consequence, if you actually need to search for either
  503. of these characters (the literal "˙" or "˚"), you will need to 'alias'
  504. them as "^˙" and "^˚". This seems a small price to pay for characters
  505. you will (I promise) _never_ have occasion to search for.
  506.  
  507. There is more at work in the Pyre. We are exhaustively trapping the
  508. keyboard. Only legal characters are passed (e.g., you can type CTRL-J
  509. all day and nothing will happen), and some are intelligently parsed.
  510. As above, space and OPT-space are converted as you type. If you
  511. should happen to want to type a "˙" or a "˚", Torquemada will alias
  512. either for you as you type (these characters will be shown unaliased
  513. if you Paste them from another application; you're responsible for
  514. your own aliasing there).
  515.  
  516. Certain Extended Keyboard keys are handled intelligently. Tab moves you
  517. forward one field, and SHIFT-Tab moves you back one field. Up and Down
  518. move you up and down one line, respectively. Home and Page Up take you
  519. to the top of the current string. End and Page Down take you to the
  520. bottom. The Delete key works (and this may be the lowest-priced
  521. application in which it does!). Help brings up the Torquemada's
  522. Wildcards scorecard, and SHIFT-Help presents the About Torquemada
  523. window.
  524.  
  525. Best keyboard news: SHIFT-Left and SHIFT-Right select (highlight)
  526. text in the way that most (non-nerd-oriented) applications work.
  527.  
  528. Torquemada's icons have changed. If you're a user of past versions of
  529. the software, you may need to force the desktop to recognize that
  530. there's a new Inquistor in town. To do this, first either delete or
  531. archive all old versions of Torque. Then do this:
  532.  
  533. If you are running System Seven:
  534.  
  535. 1. Select the program's icon and do Get Info (CMD-I)
  536.  
  537. 2. Select the icon in the Get Info window
  538.  
  539. 3. Copy, then Paste, then Cut
  540.  
  541. The Copy just loads the Paste buffer. The Paste replaces the
  542. desktop's existing icon record for Torquemada with the contents of
  543. the buffer. The Cut forces the desktop to update its records from
  544. Torquemada's resource fork.
  545.  
  546. If you are running System Six:
  547.  
  548. 1. Rebuild your desktop by restarting your Mac and holding down
  549. CMD-OPT as it boots.
  550.  
  551. 2. You will be advised that "this may take a while", and you will
  552. find that "a while" is a unit of time greater than the lifespan of
  553. some invertebrates.
  554.  
  555. After execution has begn, you can abort a batch of files with
  556. CMD-Period. This will only happen between files, not between sets or
  557. between searches.
  558.  
  559. And: there's some other stuff, but it's either transparent,
  560. intuitively obvious, or an embarrassing correction to a long-standing
  561. problem.
  562.  
  563.  
  564.  
  565. 2. String Literals
  566.  
  567. The simplest use that can be made of Torquemada is to search for
  568. string literals. This means literal text that actually appears in the
  569. source file. For example, you could search for "Elvis" and replace
  570. with "The King". If "Elvis" is present in the file, the replacement
  571. will be made. Torquemada searches are case sensitive, which means
  572. that if "elvis" or "ELVIS" are found in the file, the replacement
  573. will not be made.
  574.  
  575. String literal searching is common; most applications that have a
  576. search and replace function work only on string literals. Used this
  577. way, TQM offers not much more than they, except that you can search
  578. for 20 (or infinity!) string literals at once.
  579.  
  580. But consider: residents of British Commonwealth nations have a tough
  581. way to go when they try to use text written in the United States. A
  582. massive batch of string literals can be just the ticket.
  583.  
  584. And: string literals help to establish uniqueness in search strings
  585. that employ wildthings of various stripes. (I'm not sure I really
  586. have to say this, so I'd better.) Uniqueness means taking pains to be
  587. sure that a search finds only those particular strings you want
  588. changed, and not others. For example, our Queen's English-speaking
  589. friends might want to change color and favor to colour and favour.
  590. They might write the literal search:
  591.  
  592. or              our
  593.  
  594. This is pretty drastically non-unique. It would change the two
  595. desired words, but it would also change the name of this software to
  596. Tourquemada.
  597.  
  598. Uniqueness is one of those things that can only be learned the hard
  599. way. So if the idea is new to you, spend half a day playing with
  600. copies of files.
  601.  
  602.  
  603.  
  604. 3. Aliases
  605.  
  606. ALIASES—Match special text characters
  607.   ^T or ^t    Tab
  608.   ^P or ^p    Carriage return
  609.   ^^          Caret
  610.   ^˙          ˙  ({OPT-h})
  611.   ^˚          ˚  ({OPT-k})
  612.  
  613. You can't type a tab or a return in a dialog box. The Mac toolbox
  614. filters for these characters, regarding them as commands. Tab moves
  615. you from field to field, while hitting return is the same as clicking
  616. the mouse on the Okay button. This is hardly news.
  617.  
  618. If you want to search for one of these characters, you have to use an
  619. 'alias' of it. Torquemada uses Word's convention for denoting these
  620. aliases: tab is known as ^t or ^T, and return is wanted in five
  621. states under the name ^p or ^P. The caret character is used to flag
  622. all of Torque's many wildthings, so it too should be aliased in
  623. search and replace strings: ^^. The caret is ideal for our purposes,
  624. since it almost never appears in text. And, as discussed above, OPT-h
  625. and OPT-k are aliased so that we can use them for better purposes.
  626.  
  627. Take note that you _can_ Paste tabs and returns into a dialog box. If
  628. you do, Torquemada will behave as you expect (since the aliases are
  629. just being turned into the literal tab and return characters at
  630. search time). When you Save Set, a clean-up is run that converts any
  631. Pasted tabs or returns into their aliased form.
  632.  
  633.  
  634.  
  635. 4. Case Conversion
  636.  
  637. CASE CONVERSION COMMANDS—Can be used only on the replace side;
  638.                          accented characters are handled
  639.                          intelligently
  640.   ^C or ^c    CONVERT TO ALL CAPS
  641.   ^L or ^l    convert to all lower case
  642.   ^S or ^s    Convert to sentence caps
  643.   ^U or ^u    Convert To Upstyle Caps
  644.   ^D or ^d    Convert to Downstyle Caps
  645.   ^=          Cancel all case conversion
  646.  
  647. Torquemada includes six case conversion commands that are available
  648. on the replace side only. If your source text is typed ALL CAPS, you
  649. can convert it to sentence caps fairly easily. The commands can be
  650. used only on the replace side because they control the output format
  651. of the text found; they are not themselves something that can be
  652. searched for. If you forget and put one in on the search side, TQM
  653. will cheerfully ignore it with no untoward consequences.
  654.  
  655. But: case conversion by software is far from an exact science. The
  656. commands will get you closer to where you want to be, but you may
  657. have to run additional searches or do manual edits to achieve the
  658. final desired results. This is particularly true of sentence caps and
  659. downstyle caps (first letter of every word capitalized, except for
  660. words of three or fewer letters).
  661.  
  662. However: Torquemada is pretty smart. If your text is totally toasted,
  663. using these commands will save you a _lot_ of time. And the
  664. Inquisitor is a good global citizen: accented characters are
  665. converted appropriately. Moreover, Torque knows when to say when.
  666. Quark's XPress Tags language is case-sensitive ('k' and 'K' mean two
  667. different things). Only one of XP8's commands is case-sensitive. But
  668. in both cases, we're insulating those commands from case conversion.
  669.  
  670. Face it: a file that is typed _all_ in the wrong case is the rare
  671. bird. Further on, we'll see how to use these commands in conjunction
  672. with other wildthings to selectively change case. For example, you
  673. could take just the subheads to ALL CAPS, or change any ALL CAPS
  674. headline to Upstyle Caps. For now, we'll just talk about using these
  675. with string literals. This search:
  676.  
  677. Elvis           ^CElvis^=
  678.  
  679. would result in the word "ELVIS" being written out to the file. In
  680. the replace string, ^C means convert to all caps, and ^= means cease
  681. to convert case. (Of course, a search this simple could be done simply
  682. with literals.) You don't need to use ^= if it is the last thing in
  683. the replace string; Torque will put one there if it doesn't find one.
  684. On the other hand, if you need to terminate case conversion _within_
  685. the replace, then you must explicitly turn it off:
  686.  
  687. Elvis is still the king         ^CElvis^= is still ^Uthe king
  688.  
  689. would result in the text "ELVIS is still The King". We turned
  690. capitalization off after "ELVIS" to avoid changing the case of "is
  691. still". We didn't need to turn upstyle off, since it will be
  692. terminated automatically at the end of the replace string.
  693.  
  694. (For users of earlier versions: Torquemada's case-conversion
  695. routines were made substantially smarter with version 1.2.0.)
  696.  
  697.  
  698.  
  699. 5. Untyped Wildcards
  700.  
  701. UNTYPED WILDCARDS—Match any one character
  702.   ^0, ^1, ^2, ^3, ^4
  703.  
  704. Okay, this is where the bullet hits the bone. I've been dancing
  705. around this for quite a while, because I wanted to establish good
  706. ground rules before we got to the more hirsute topics. Well, here we
  707. are...
  708.  
  709. Torquemada has 5 untyped wildcards. 'Wildcards' means they are not
  710. literal characters, but rather markers that will match literal
  711. characters. 'Untyped' means they will match _any_ character. In Word,
  712. '?' is a wildcard, but it can only be used on the search side.
  713. Torquemada's wildcards can be used on the search side, and can be
  714. used, omitted or resequenced on the replace side. Torquemada's
  715. untyped wildcards are denoted by the caret character followed by a
  716. number from 0 to 4. Each one of them will match any character and
  717. _store_ the character matched. Taking our earlier example:
  718.  
  719. ^0^1^2or        ^0^1^2our
  720.  
  721. will match and change color and favor. Unfortunately, it still lacks
  722. uniqueness. Because these wildcards are totally untyped, the search
  723. string will also match any instance of the letters "or" and the three
  724. characters before it.
  725.  
  726. Here's a better example. Suppose we have text that looks like this:
  727.  
  728. 1. Blah.
  729. 2. Blah blah.
  730. 3. Blah. Blah blah.
  731.  
  732. If we needed to modify this, say to add a Quark 'Indent Here' command
  733. to make sure that blahish turnovers hang on the indent, we could do:
  734.  
  735. ^p^0.{space}    ^p^0.{space}<\i>
  736.  
  737. Surely we could do this with literals, but that would get tiresome.
  738. Instead, we can use our knowledge to carefully control ignorance, and
  739. accomplish in one string what might otherwise take three. Note that
  740. we are isolating to uniqueness the text we hit; without the ^p and
  741. the {space}, '^0.' would also match the ends of sentences.
  742.  
  743. Perhaps the best use of untyped wildcards is as ballast for the typed
  744. wildcards (to be discussed next). They do what they do alone quite
  745. well, but it's almost too much ignorance safely to be borne.
  746.  
  747. (Take note: prior to version 1.2.0, Torquemada had 10 untyped
  748. wildcards. If you have old sets that made use of ^5 through
  749. ^9, you will need to revise them.)
  750.  
  751.  
  752.  
  753. 6. Typed Wildcards
  754.  
  755. TYPED WILDCARDS—Match any one character of that type
  756.   ^+    Uppercase character (includes accented characters)
  757.   ^-    Lowercase character (includes accented characters)
  758.   ^±    Character of either case (includes accented characters)
  759.   ^&    Alphanumeric character (letter or number, not space or punctuation)
  760.   ^%    Tabular character (digit, space or punct.; not alphabetical)
  761.   ^$    Printable character (all characters _except_ space characters)
  762.   ^¢    Any character _EXCEPT_ return
  763.   ^!    Punctuation character (includes high-ASCII punctuation)
  764.   ^.    Sentence Punctuation character (.,;:!?)
  765.   ^#    Numeric character (digits only)
  766.   ^_    Space character (space, return, tab, option space)
  767.   ^¬    Space character (space, tab, option space, but _NOT_ return)
  768.  
  769. (^¢, ^. and ^¬ were added with version 1.2.0.)
  770.  
  771. These are alike unto the untyped wildcards except that they are
  772. strongly typed. A typed wildcard will only match a character of its
  773. type. So, for instance: ^+ will only match uppercase characters, with
  774. all others failing to match. The wildcard ^# will match any digit,
  775. and ^_ will match any space character, so we can go back to blahville
  776. and do a much better job:
  777.  
  778. ^p^#.^_         ^p^#.^_<\i>
  779.  
  780. This is now fully generalized yet completely unique. If there is a
  781. subtopic such as:
  782.  
  783. a. Subblah.
  784.  
  785. it will fail to match. If we need to do something different with
  786. that, we can match it with another, different string.
  787.  
  788. But: wildcards (typed or untyped) match and store only _one_
  789. character. If you search for:
  790.  
  791. ^#^#
  792.  
  793. only the second digit will be stored. If you need to match and store
  794. two characters of one type, you can use the typed wildcards to
  795. establish uniqueness, then fill out your team with untyped wildcards.
  796. Suppose we needed to match:
  797.  
  798. 10. Double-digit blah.
  799.  
  800. This would work:
  801.  
  802. ^p^#^0.^_       ^p^#^0.^_<\i>
  803.  
  804. Pretty cryptic, not. This says: where you find a return followed by a
  805. digit followed by any other character followed by a period followed
  806. by a space character, soak it all up and spew it back out, appending
  807. an XPress Tags 'Indent Here' command. We've gone from string literals
  808. that were readable but not very useful to _this_, a vitally important
  809. message from space aliens (grin). And it gets worse. Very shortly,
  810. we'll discuss an even better - and more cryptic - way of handling
  811. this type of problem.
  812.  
  813.  
  814. Not for non-nerds only:
  815.  
  816. Mike Arst quite correctly pinned me to the mat for not going into
  817. these guys in greater detail. Among the wildthings, these present the
  818. greatest potential for confusion. Untyped wildcards (discussed above)
  819. and wildstrings (discussed below) match _anything_. The typed
  820. wildcards only match characters _of their type__ So: this is a
  821. further elucidation of what "of their type" means.
  822.  
  823. Torquemada is written in the C programming language, and the idea of
  824. typed wildcards is borrowed, analogically, from the character typing
  825. functions available in the standard C function libraries. Where
  826. appropriate, these commands use the full Macintosh character set,
  827. where the C functions do not, but the idea is basically the same. A
  828. typed wildcard matches the source character _if and only if_ the
  829. character is of that type; ^+ will match _only_ uppercase letters,
  830. not lowercase letters, not space or punctuation characters, not
  831. digits.
  832.  
  833. Taking them one by one:
  834.  
  835. ^+    Will match and store any one uppercase alphabetical
  836. character. Alphabetical characters include the accented Macintosh
  837. characters (e.g., Á, Å). This will _fail_ to match any character that
  838. is not an uppercase character.
  839.  
  840. ^-    Will match and store any one lowercase alphabetical
  841. character. Alphabetical characters include the accented Macintosh
  842. characters (e.g., á, å). This will _fail_ to match any character that
  843. is not a lowercase character.
  844.  
  845. ^±    Will match and store any one alphabetical character.
  846. Alphabetical characters include the accented Macintosh characters
  847. (e.g., Á, Å, á, å). This will _fail_ to match any character than is
  848. not an alphabetical character. This wildcard is the logical opposite
  849. of the tabular character wildcard (^%). (You type the "±" by
  850. hitting SHIFT-OPT-=.)
  851.  
  852. ^&    Will match and store any one alphanumeric character.
  853. Alphanumeric characters are alphabetical characters (including
  854. accented characters) and the ten digits. This wildcard will _fail_ to
  855. match any space or punctuation character, which can make it useful
  856. for establishing uniqueness.
  857.  
  858. ^%    Will match and store any one tabular character. A tabular
  859. character is any one of the ten digits, a space character (space,
  860. return, tab, or option space), or a punctuation character (including
  861. Macintosh high-ASCII punctuation such as ° or ‡). This wildcard is
  862. intended primarily for matching the elements that make up a table,
  863. exclusive of the explanatory text. Consequently, it will _fail_ to
  864. match any alphabetical character, which can make is useful for
  865. establishing uniqueness. This wildcard is the logical opposite of the
  866. alphabetical character wildcard (^±).
  867.  
  868. ^$    Will match and store any one printable character. A printable
  869. character is one that makes marks on paper, which means that this
  870. wildcard will match all alphabetical characters, all ten digits, and
  871. all punctuation characters. It will _fail_ to match the space
  872. characters (space, return, tab or option space). This wildcard is the
  873. logical opposite of the space character wildcard (^_).
  874.  
  875. ^¢    Will match and store any one character _that is NOT a carriage
  876. return character_. Ergo, it will _fail_ to match return. (You type
  877. the "¢" by hitting OPT-4.)
  878.  
  879. ^!    Will match and store any one punctuation character, (including
  880. Macintosh high-ASCII punctuation such as ° or ‡). It will _fail_ to
  881. match alphabetical, numeric, or space characters.
  882.  
  883. ^.    Will match and store any one sentence punctuation character.
  884. The sentence punctuation characters are defined as: ".,;:!?" (not
  885. including the dumb quotes). This wildcard was added because the
  886. regular punctuation wildcard (^!) is too general in many
  887. circumstances. This wildcard will match only the six sentence
  888. punctuation characters and it will _fail_ to match all other
  889. characters.
  890.  
  891. ^#    Will match and store any one numeric character (the ten
  892. digits). It will _fail_ to match alphabetical, space, or punctuation
  893. characters.
  894.  
  895. ^_    Will match and store any one space character (space, return, 
  896. tab, or option space). It will _fail_ to match all alphabetical,
  897. numeric, or punctuation characters. This wildcard is the logical
  898. opposite of the printable character wildcard (^$).
  899.  
  900. ^¬    Will match and store any one space character _that is NOT a
  901. carriage return character_. In consequence, it matches only space,
  902. tab and OPT-space. It will _fail_ to match all other characters.
  903.  
  904.  
  905.  
  906. 7. The Do-It-Yourself Wildcard
  907.  
  908. The Typed Wildcards are pretty through, but sometimes you just have
  909. to Do-It-Yourself. This wildcard lets you. The DIY wildcard matches
  910. the characters _you_ define, and it fails to match any you leave out.
  911. Your definition can include literal characters (abc), ranges of
  912. characters (a-c), or any of the other wildcards (^!abcx-z^#^_). Even
  913. better, you can write the definition in the negative, specifying only
  914. what will _fail_ to match. That is, you could define a DIY wildcard
  915. that would fail to match all digits, all space characters, all
  916. punctuation characters and all low-ASCII alphabetical characters;
  917. this wildcard would match _only_ high-ASCII (accented) alphabetical
  918. characters.
  919.  
  920. Let's ease our way into this, because it's a little complicated. The
  921. form of the DIY wildcard is this:
  922.  
  923. ^«...»
  924.  
  925. The leading caret is familiar enough by now. The next character, the
  926. open-guillemot, is typed by hitting the OPT-\ (backslash) key. The
  927. "..." represents the definition of the DIY wildcard, which we'll come
  928. to shortly. The last character, the close-guillemot, is typed by
  929. hitting SHIFT-OPT-\. This charcter tells Torque that the definition
  930. is done. The definition of a DIY wildcard _must_ end with a "»", with
  931. one exception. If the DIY wildcard is the very last thing in a
  932. string, you can leave it out, in the same way that you can skip "^="
  933. in similar circumstances. Everywhere else, the close-guillemot must
  934. be present. If it isn't, the Inquisitor won't know where to stop the
  935. difinition.
  936.  
  937. But what if you need a close-guillemot _as a part_ of your DIY
  938. wildcard defiinition? Bright sparks will have already guessed the
  939. answer: you alias it as ^». The string
  940.  
  941. ^«^»»
  942.  
  943. will match _only_ the close-guillemot character.
  944.  
  945. On the search side, you show the full definition. On the replace
  946. side, you show _only_ the ^«, omitting the definition. Like this:
  947.  
  948. ^«abc»         ^«
  949.  
  950. The ^« is actually _storing_ the character found. The rest of the
  951. difintion is just establishing _what_ will match, which is why it is
  952. omitted on the replace side.
  953.  
  954. The definition of a DIY wildcard can be _retained_ from one string to
  955. the next. If you put nothing between the opening and closing
  956. guillemots, the previously-established definition will be used again.
  957. As before, if it's the last thing in the string, you can leave off
  958. the close-guillemot. So, for example:
  959.  
  960. ^«abc»         ^«          (Matches a, b or c)
  961. ^«»            ^«          (Still matches a, b or c)
  962. ^«             ^«          (Still matches a, b or c)
  963.  
  964.  
  965. Important: the DIY wildcard is just a special case of the ordinary
  966. typed wildcard. It will match and store only _one_ character, the
  967. first one found that fits the definition and the full pattern of the
  968. search string. It behaves just like any other wildcard. If you use
  969. more than one in the search string, only the _last_ one found will be
  970. deployed in the replace. And, as with the other wildcards, it can be
  971. used, omitted or resequenced on the replace side.
  972.  
  973. Okay, here's how to define one. This string:
  974.  
  975. ^«ABCabc»
  976.  
  977. will match any one of those literal characters, and no others. You
  978. can include as many literal characters as you want.
  979.  
  980. This string:
  981.  
  982. ^«A-Z»
  983.  
  984. will match the _range_ of characters from A to Z, inclusive. A range
  985. can be established by refrence to an ASCII chart. The range will
  986. include every character from the start of the range to the end. For
  987. example, you could do a less general tabular wildcard with
  988.  
  989. ^«#-9»
  990.  
  991. This would match everyting from # (ASCII 35) to 9 (ASCII 57),
  992. inclusive. (This is the definition XP8 uses for tabular characters).
  993.  
  994. Take note: in most GREPs, a range must be an _ascending_) range. This
  995. is not true in Torquemada. You could just as easily say ^«Z-A» or
  996. ^«9-#».
  997.  
  998. You can have more than one range in a definition, or ranges plus
  999. literals, like this:
  1000.  
  1001. ^«A-Zz-a01234567890»
  1002.  
  1003. or this:
  1004.  
  1005. ^«01234567890A-Zz-a»
  1006.  
  1007. or this:
  1008.  
  1009. ^«A-Z01234567890z-a»
  1010.  
  1011. Each of these would match _only_ digits or low-ASCII alphabetical
  1012. characters, with all others failing to match.
  1013.  
  1014. And: you can include other wildcards _within_ your definition. This
  1015. string:
  1016.  
  1017. ^«^#A-Zz-a»
  1018.  
  1019. does the same job as the three listed above. Since the DIY wildcard
  1020. is establishing the _type_ of characters it will match in its
  1021. definition, it makes sense to inlcude the other typed wildcards
  1022. within the definition. This:
  1023.  
  1024. ^«A-Zz-a^#^!^_»
  1025.  
  1026. will match everything _except_ high-ASCII (accented) alphabetical
  1027. characters. Heck of a lot faster than typing all of those
  1028. hand-breakers.
  1029.  
  1030. Important: you can put either untyped wildcards or wildstring tokens
  1031. (discussed below) into your definition. If you do, the DIY wildcard
  1032. will match _anything_, since this is the range of characters defined
  1033. by those wildthings. I don't think this is such a swell idea, but I
  1034. made it possible just because you might need one extra untyped
  1035. wildcard someday. In any case, no matter what else is defined, a
  1036. (non-negative) DIY wildcard that includes either an untyped wildcard
  1037. or a wildstring token will match anything.
  1038.  
  1039. At the end of this section, we'll discuss some uses of typed
  1040. wildcards with the DIY wildcard.
  1041.  
  1042. Here's the coolest part: you can write a _negative_ definition. In
  1043. other words, you can define only what will _fail_ to match, with all
  1044. other characters matching. This string:
  1045.  
  1046. ^«!A-Zz-a^#^!^_»
  1047.  
  1048. will match _only_ high-ASCII (accented) alphabetical characters. The
  1049. leading exclamation point establishes the definition as negative. The
  1050. remainder of the string specifies the characters that will _fail_ to
  1051. match the DIY wildcard. Since the only characters that are not
  1052. spaces, punctuation, digits or low-ASCII letters are accented
  1053. characters, these are the _only_ characters that will be matched.
  1054.  
  1055. As above, untyped wildcards and wildstring tokens can be included in
  1056. a negative definition, but the results are guaranteed to be
  1057. non-optimal. This
  1058.  
  1059. ^«!^4»
  1060.  
  1061. says "match and store nothing". The "!" says "don't match" and the
  1062. "^4" says "every possible character". Search strings that include any
  1063. variation on this construct are entirely dysfunctional and will
  1064. result in no replacements. No extra charge...
  1065.  
  1066. The negative definition is a notational convenience. It does nothing
  1067. that cannot be done with a positive (normal) definition. It's just
  1068. faster, and, very often, easier on the hands and head. For example,
  1069. if you need a second ^¢, you can get it very easily with:
  1070.  
  1071. ^«!^p»
  1072.  
  1073. But wait! What if we need a "!" as part of our definition? And what
  1074. about the "-" character? The exclamation point and hyphen establish
  1075. their meaning from their _position_ within the definition. The
  1076. definition is negative _if and ONLY if_ the exclamation point is the
  1077. first character in the definition. Otherwise, it's interpreted as a
  1078. literal text character. So if you need it in your definition, put it
  1079. anywhere but in the first position.
  1080.  
  1081. The hyphen is but slightly trickier. To include a hyphen in your
  1082. definition, put it in the first position, or in the second if the
  1083. first is occupied by an exclamation point. All other hyphens are
  1084. interpreted as defining ranges.
  1085.  
  1086. Here are some cool ways the DIY wildcard can be used along with other
  1087. wildcards.
  1088.  
  1089. If you have a font that uses the high-ASCII slots for purposes other
  1090. than those decreed by Adobe, you can use the DIY wildcard to insulate
  1091. those slots from case conversion:
  1092.  
  1093. ^«A-z»          ^U^«^=
  1094.  
  1095. This would convert _only_ low-ASCII alphabetical characters to
  1096. Upstyle initial caps. There are some punctuation characters in that
  1097. range, but they don't matter since case conversion ignores them.
  1098. (And, yes,  both "»" and "^=" are redundant in this context, but Good
  1099. Practice decrees that we put them in. If, later, I add somehting to
  1100. the end of either string, I don't have to remember to add them, or
  1101. suffer the consequences of having forgotten to remember. In other
  1102. words, their omission is tolerated (and coded for) but Not
  1103. Recommended.)
  1104.  
  1105. You could use a very simple sort of definition to more firmly
  1106. establish uniqueness. For example,
  1107.  
  1108. ^#^«^#»
  1109.  
  1110. will match _only_ two consecutive numbers. Something like ^#^& or ^#%
  1111. might let some wierdness through.
  1112.  
  1113. Obviously, you can use wildcards singly, as above, to create a
  1114. temporary twin. And you can use them in combination (along with
  1115. literals and ranges) to establish your own special types. And, of
  1116. course, the _antithesis_ of any typed wildcard can be had simply by
  1117. negating it. This
  1118.  
  1119. ^«!^+»
  1120.  
  1121. will match anything that is _not_ an uppercase letter.
  1122.  
  1123. This is not the easiest stuff in the world, but it repays mastery. In
  1124. the section after next, you'll find out why we spent so much time
  1125. talking about it.
  1126.   
  1127.  
  1128.  
  1129. 8. Wildstrings
  1130.  
  1131. WILDSTRINGS—Match and store any text until full pattern is matched
  1132.   ^*, ^~, ^?, ^@
  1133.  
  1134. Now this is the really cool stuff. There are four wildstrings and
  1135. each will match and store any text until the pattern defined in the
  1136. search string is satisfied. As an example, consider a full case
  1137. conversion. You got a file typed in ALL CAPS, and you need it to be
  1138. Sentence caps. This will do the job:
  1139.  
  1140. ^~        ^S^~
  1141.  
  1142. The search string says: "match anything, from the start of the buffer
  1143. to the end." The replace string says, "spew it all back out with the
  1144. case converted".
  1145.  
  1146. A more complicated example: the client was thoughtful enough to
  1147. provide the keystrokes on disk, but the heads and subheads are all
  1148. typed ALL CAPS (there are many such thoughtful clients). To convert
  1149. them all to Upstyle (presuming that the heads to be hit are preceded
  1150. by double-returns), you could do:
  1151.  
  1152. ^p^p^*^p        ^p^p^U^*^p^=
  1153.  
  1154. Wildstrings are massively general. Except for gross transformations,
  1155. you really have to build a lot of uniqueness into the pattern, or
  1156. they will bleed all over you. But try this on for size: I wish I
  1157. could count the number of times I've gotten files that were typed
  1158. like this:
  1159.  
  1160. First        Fifth
  1161. Second       Sixth
  1162. Third        Seventh
  1163. Fourth       Eighth
  1164.  
  1165. In every publishing system known to humanity, this should be typed as
  1166. one long column, with fifth following fourth. The helpful clients
  1167. type it in two columns with tabs so that you'll know it should be one
  1168. link spanning a gutter. Do it the cheap way, with tabs, and surely
  1169. you'll have to insert a line between second and third. Have fun
  1170. cutting and pasting... Or: run a set like this:
  1171.  
  1172. ^t^*^p        ^p
  1173.  
  1174. This will throw away everything in the right column, preserving
  1175. everything in the left. Then run:
  1176.  
  1177. ^p^*^t        ^p
  1178.  
  1179. This will throw away everything in the left column, preserving the
  1180. right.
  1181.  
  1182. Then concatenate the two files and you've got the text the way you
  1183. need it, in one long column.
  1184.  
  1185. How these work: wildstrings will match and store any characters found
  1186. in the source until the full pattern is matched. If the pattern is
  1187. matched immediately after the call to the wildstring, it will store
  1188. zero characters. This is useful. It means you can say:
  1189.  
  1190. ^p^~^$        ^p^$
  1191.  
  1192. This will find all runs of one or more returns (or returns with other
  1193. space characters) and compact them down to exactly one return. If the
  1194. file has only single returns in it, the wildstring will contain zero
  1195. characters each time it is employed.
  1196.  
  1197. If the pattern fails to match, the text is passed through unaltered.
  1198.  
  1199. A wildstring can contain the whole buffer of text, as shown above.
  1200. Searching for a pattern match will continue to the end of the buffer.
  1201. In consequence, insufficient uniqueness can result in failures to
  1202. find a match along with very slow performance. So: be sure to deploy
  1203. these puppies in full cognizance of the actual contents of the file.
  1204.  
  1205. Wildstrings are completely untyped, but they can be fairly strongly
  1206. 'typed' by the characters used before and after them. Needless to say,
  1207. string literals provide the strongest typing, but the more strident
  1208. typed wildcards also do very well. The string above that illustrates
  1209. how to compact runs of returns is a good example: we are saying
  1210. "match everything from a return to a printable character". Printable
  1211. characters are characters that are _not_ spaces, so the wildstring is
  1212. 'typed' to contain _only_ space characters. A string like this:
  1213.  
  1214. ^t^%^~^p        ^t<f"E Century">^%^~<f$>^p
  1215.  
  1216. will find the tabular columns of a table (viz., not the text stubs at
  1217. the left margin) and plug in XPress Tags coding to change the font.
  1218.  
  1219. A search string can contain more than one wildstring, up to the full
  1220. complement of four. At the same time, wildstrings can be resequenced
  1221. on the replace side. So, if that Officers and Directors chart comes
  1222. with the jobs before the names, you can swap them.
  1223.  
  1224. One more (this happened to me recently, and it's happened many times
  1225. in the past): pick up last year's financials, lose the right-most
  1226. column, kick everything right, and plug in a new column for this
  1227. year's figures. Bah! Mondo-beyondo manual labor, even with QuicKeys.
  1228. Here's a quick set that does the job on my kind of three-column
  1229. table:
  1230.  
  1231. <t41>^t<t-3>^t^*^t^~^t^?^p        <t41>^t<t-3>^tXX^t^*^t^~^p
  1232.  
  1233. The "XX" is there to hold the tab, to give the operator something to
  1234. double-click on. Yes, the operator had to type the figures;
  1235. intelligent hashing is for next week (grin). But: moving the columns
  1236. took minutes instead of hours, and the proofreader only had to read
  1237. the new copy, not the whole job.
  1238.  
  1239. Note: if you want, you can include the same one wildstring more than
  1240. once on the replace side. The set "Use last name twice" illustrates
  1241. the principle. If you run it on the file named "Use last name
  1242. twice.test", then compare the two files, you'll see how useful this
  1243. can be.
  1244.  
  1245. On the point: it has always been possible to repeat wildcards on the
  1246. replace side - just not terribly useful. Using wildstrings this way
  1247. won't come up every day, either, but it's a nice thing to have when
  1248. you need it.
  1249.  
  1250. There is a _ton_ of power in these babies, so do take the time to
  1251. master them, The effort will be repaid a hundred-fold.
  1252.  
  1253.  
  1254.  
  1255. 9. The Wildstring Modifier
  1256.  
  1257. You may not know it yet, but _this_ is why you paid cash money for this
  1258. software. Every wildthing that was added with version 1.2.0 - ^¢, ^.,
  1259. ^¬, and the DIY wildcard - was added in the service of this token. I
  1260. call it a token, because it's not really a wildcard. It doesn't
  1261. _match_ anything. What it does is constrain the type of characters
  1262. that a wildstring can match.
  1263.  
  1264. The wildstring modifier looks like this: "^<". You use it in strings
  1265. like this:
  1266.  
  1267. ^#^<^~
  1268.  
  1269. That says: match and store one digit, then continue match digits
  1270. until the first non-numeric character, then _stop_ matching. In other
  1271. words, the wildstring will contain _nothing_ but (zero or more)
  1272. digits, nothing else. Its wildness has been _contstrained_, reined in
  1273. by by the wildstring modifier. An unmodified wildstring will match
  1274. and match and match, ceaselessly. But when it is preceded by the
  1275. wildstring modifier, it will _only_ match the type of the character
  1276. that immediately precedes the wildstring modifier.
  1277.  
  1278. In use, it looks like this:
  1279.  
  1280. ^#^<^~          ^#^~
  1281.  
  1282. The wildstring modifier is omitted on the replace side, since its
  1283. only purpose is to constrain the wildstring during the search. If you
  1284. forget and put it on the replace side, guess what happens? Yes, of
  1285. course, Torquemada cheerfully ignores it.
  1286.  
  1287. The wildstring modifier is position dependent. It must be preceded by
  1288. a character or a wildcard (not a wildstring), and it must be followed
  1289. by a wildstring (not a character or a wildcard). If the sequence of
  1290. characters in the search string fails to satisfy that form, the
  1291. wildstring modifier itself is ignored (the rest of the search string
  1292. is honored).
  1293.  
  1294. If the wildstring modifier is preceded by a wildcard, the wildstring
  1295. is constrained to the type of that wildcard. For example, you could
  1296. clean up a badly-formatted table like this:
  1297.  
  1298. ^%^<^?          |^%^?          (Mark all table columns)
  1299. ^_^<^?|         ^t             (Compact all space runs before
  1300.                                table columns to one tab)
  1301.  
  1302. And yes, the wildstring modifier can be legally preceded by an
  1303. untyped wildcard, but this would be an entirely redundant
  1304. construction.
  1305.  
  1306. If the wildstring modifier is preceded by a literal character, the
  1307. wildstring is constrained to _that character EXACTLY_. Earlier we
  1308. talked about using wildstrings to compact runs of returns (keep in
  1309. mind that "^p" is an alias for a literal character). Here's a far
  1310. better way:
  1311.  
  1312. ^p^<^?          ^p
  1313.  
  1314. Here's a similar example: the client made a fill-in-the-blanks form
  1315. using scads of underbars. You could do this:
  1316.  
  1317. _^<^?           ^t          (Convert underbar runs to a tab)
  1318.  
  1319. Of course, if you want to retain a certain minimum number of
  1320. underbars, just use one more than that number in your search string.
  1321. This will preserve three or fewer:
  1322.  
  1323. ____^<^?        ^t
  1324.  
  1325. _Only_ the character or wildcard immediately preceding the wildstring
  1326. modifier is used to constrain the wildstring. Suppose you need to
  1327. "cast" the wildstring to more than one type...?
  1328.  
  1329. If you said "DIY wildcard", score one for you. Of course, the _whole_
  1330. pattern must match before the replace will take place, as with the
  1331. four underbars above. But you can keep it short and sweet with the
  1332. DIY wildcard. The table example above can let some stuff through that
  1333. you might not want, resulting in superfluous tabs. This is more
  1334. unique, hence safer:
  1335.  
  1336. ^«#-9»^<^?          |^«^?          (Mark all table columns)
  1337. ^¬^<^?|             ^t             (Compact all space runs before
  1338.                                    table columns to one tab)
  1339.  
  1340. The first search defines "tabular character" more rigorously
  1341. (^«$%(),.-^#» is more rigorous still), resulting in fewer false
  1342. positives. The second line matches _only_ space characters _that are
  1343. in the same paragraph_ as the mark we left behind. This is _why_ both
  1344. "^¬" and "^¢" exist. One of Torquemada's best features is his ability
  1345. to read around returns, but sometimes it's too much of a good thing;
  1346. you can wait a long time to achieve results far removed from your
  1347. expectations. Torquemada does _exactly_ what you tell him to do.
  1348. Those two typed wildcards, in conjunction with the wildstring
  1349. modifier, let you order the Inquisitor around in more strident terms.
  1350. So, what's the benefit? In the second line above, the string is
  1351. forbidden to toast the return in source copy that looks like this:
  1352.  
  1353. Stub     $123
  1354. Stub     $456
  1355.          $789
  1356.  
  1357. That stubless third line would get hosed by our first example, but
  1358. not the second.
  1359.  
  1360. The trick is to manage your knowledge in such a way that you can use
  1361. it to leverage ignorance into certainty. In a badly formatted table,
  1362. there will be _plenty_ of extra spaces, but only _some_ of them
  1363. should be compacted to tabs. The rest should become single spaces.
  1364. We're using our knowledge to isolate cases of the first type, then
  1365. operating intelligently on _only_ those. The marking trick we're
  1366. doing in the table will be discussed more in the next section.
  1367.  
  1368. This has come up: the text looks something like this:
  1369.  
  1370. 1 This line contains K1.
  1371. 2 This line contains K1 and K2.
  1372. 3 This line contains K2.
  1373. 4 This line contains K2 and K1.
  1374. 5 This line contains K1.
  1375. 6 This line contains K1 and K2.
  1376. 7 This line contains K2.
  1377. 8 This line contains K2 and K1.
  1378.  
  1379. where "K1" and "K2" are known instances of literal text. We want to
  1380. operate _only_ on lines that contain both K1 and K2, in that order.
  1381. This example is obviously trivialized; in real life we can't count on
  1382. the consistency of the surrounding text. A straight wildstring search
  1383.  
  1384. K1^?^K2         <B>K1^?K2<B>
  1385.  
  1386. would result in garbage. It would also take a while on a big file,
  1387. since any failures will have to fail to the end of the buffer. No
  1388. fault: Torquemada is doing what we told him to do. By contrast,
  1389.  
  1390. K1^¢^<^?K2      <B>K1^¢^?K2<B>
  1391.  
  1392. will do exactly what we want, and very quickly to boot. Because the
  1393. wildstring can only match characters that are _not_ the carriage
  1394. return character, the search pattern will _fail_ to match as soon as
  1395. that character is encountered. Only lines 2 and 6 match the pattern,
  1396. so the replace string will be deployed only on those two.
  1397.  
  1398. And: you can use DIY wildcard definitions to create additional
  1399. same-paragraph wildstring modifiers. For example
  1400.  
  1401. ^«!^!^p»^<^?
  1402.  
  1403. will match only non-punctuation characters that are all in the same
  1404. paragraph.
  1405.  
  1406. Because "^<" stores nothing, there is no restriction on the number of
  1407. times it can be used on the search side. Obviously, you should not use
  1408. it any more than four times (one for each wildstring) if you are
  1409. retaining the copy from all wildstrings. But if you are tossing copy
  1410. for one or more wildstrings, you can use it as many times as you need it.
  1411.  
  1412. For example:
  1413.  
  1414. If you have copy like this:
  1415.  
  1416. Good    junk    junk    junk    junk    junk    Good    Good
  1417.  
  1418. this string:
  1419.  
  1420. ^?^t^$^<^*^t^$^<^*^t^$^<^*^t^$^<^*^t^$^<^*^t^~^p     ^?^t^~^p
  1421.  
  1422. will pack and repack all of the junk into the same one wildstring,
  1423. which is being thrown away in any case.
  1424.  
  1425. Included on this disk is a commented set called "Extract Text from
  1426. PostScript". This is still under construction. There is much about it
  1427. that is not ideal, just yet. It permits too much garbage to pass
  1428. through, and it takes a _long_ time to run (since it's main job is
  1429. matching and throwing away everything that _isn't_ text). But it gets
  1430. better every time I play with it, and it illustrates some of these
  1431. concepts very well. And - who knows? Someday you may need desperately
  1432. to recover the keystrokes from a PostScript file. With the wildstring
  1433. modifier, you can do it...
  1434.  
  1435.  
  1436.  
  1437. 10. Torquemada's Ghost
  1438.  
  1439. Torquemada's Ghost is simply an AppleEvent-aware version of the
  1440. Torquemada S&R engine. While it can be used interactively by Drag &
  1441. Drop, its primary purpose is to allow AppleEvent scripters to access
  1442. Torquemada from their AppleScript or Frontier scripts. Frontier
  1443. scripter Eugene Barnes has lent us his expertise by writing Frontier
  1444. glue scripts for Torquemada's Ghost. These scripts and their
  1445. documentation can be found in the folder "Torquemada’s Ghost Glue ƒ".
  1446.  
  1447. In essence (I am not a scripter), you would access Torquemada's Ghost
  1448. from a script like this: send a host of set files and text files to be
  1449. processed to the Ghost. As the last file in the batch, send a 'control
  1450. file', a text file with the creator TQM+. The file "GhostBuster"
  1451. explains how to build a control file (it ain't hard).
  1452.  
  1453. The control file exists to tell the Ghost what to do with the files
  1454. it processes. It can contain a 'path' to a destination folder. If it
  1455. does, then the newly created '.TQM' files will be created in that
  1456. destination folder, rather than in the same folders as the source
  1457. files.
  1458.  
  1459. When we finish a batch started by a control file, we make
  1460. an empty file called "Batch completed..." in the home folder of the
  1461. control file. That way, your script can keep trying to delete that
  1462. file until it succeeds. While it is failing, the batch is not
  1463. complete. As soon as it succeeds, the batch is done. In C, the loop
  1464. would look like this:
  1465.  
  1466.     while (FSDelete ("\pBatch completed...", controlFile.vRefNum))
  1467.         ;
  1468.  
  1469. FSDelete is going to return a (non-zero) error message when it fails,
  1470. so we just do this until we get a zero back, indicating success. (Note
  1471. that I wrote this in C because that's what I know. Pursue Eugene's
  1472. examples to find out how to do it in Frontier.)
  1473.  
  1474. It is also possible to use Torquemada's Ghost interactively, by Drag &
  1475. Drop. Just drop your sets and files on the icon, much as you would
  1476. with Torquemada the Inquisitor. When you hit "Start", the files will
  1477. be processed as you would expect - taking account of the important
  1478. differences noted below.
  1479.  
  1480. Interactively, it is also possible to 'target' files to a specified
  1481. destination folder. If you hold down the Command key as you hit
  1482. "Start...", you will be prompted for a destination folder for your
  1483. newly-created files.
  1484.  
  1485. Whether by script or double-click, if Torquemada's Ghost is launched
  1486. without receiving any files, it will stay resident until it is
  1487. explicitly quit. If it is launched _with_ files, it will quit at the
  1488. end of the batch. As with Torquemada the Inquisitor, you can abort a
  1489. batch of files with CMD-Period. This will only happen between files,
  1490. not between sets or between searches.
  1491.  
  1492. IMPORTANT DIFFERENCES: First, while Torquemada the Inquisitor
  1493. processes set files in alphabetical order, Torquemada's Ghost
  1494. processes S&R set files IN THE ORDER RECEIVED. The reason is this: set
  1495. files in Torquemada's Ghost can originate from many different folders.
  1496. Presumably, some are boilerplate sets used to solve common problems.
  1497. Imposing an alphabetization restriction on them would surely drive
  1498. everyone crazy.
  1499.  
  1500. Second, text files, too, can originate from different folders. You can
  1501. Drag & Drop from all over, and everything will go back where it came
  1502. from - or, alternatively, where you specify - when you hit "Start".
  1503.  
  1504. Third, Torquemada's Ghost can run in the background. If you have a
  1505. huge job to do, you can set it up and start it running, then go do
  1506. other work. Torquemada's Ghost uses a lot of cycles, so backgrounding
  1507. is not as terrifically useful as it might at first sound, but it _is_
  1508. possible. Note that even in the foreground, Torquemada's Ghost will be
  1509. somewhat slower than Torquemada's the Inquisitor.
  1510.  
  1511.  
  1512.  
  1513. 11. Putting It All Together
  1514.  
  1515. There is a boatload of Torquemada sets travelling with this document,
  1516. to illustrate various points discussed. None of the sets here is very
  1517. elaborate, but my feeling is (despite what you may surmise from
  1518. reading the DTPForum on CompuServe) the elaborate set is the
  1519. exception, rather than the rule. Most search and replace jobs are
  1520. fairly simple if they can be generalized to their essence.
  1521.  
  1522. As an admonition: if this stuff is largely new to you, you are well
  1523. advised to take your Torque in small doses. Build the vicious set
  1524. that does the worst of the reformatting, then have a look at the
  1525. output file. Write a new set to do the finer sifting, then have
  1526. another look. There is no shame in having a file named
  1527. "file.TQM.TQM.TQM.TQM". The shameful thing would be toasting your
  1528. text by trying to do too much at once. My own files tend to be named
  1529. "kill.XP8.TQM.XP8.TQM", since I use XP8 to do the gross clean up,
  1530. Torque to code for XP8, XP8 to unpack the Torque coding (e.g., I'd
  1531. much rather replace with "[n77]" than "<f"Univ NewswCommPi">M<f$>"),
  1532. then Torque, finally, to finesse. What works best is what works
  1533. fastest, not the set that wins the Nobel Prize for Cryptic
  1534. Communication With Space Aliens (this from the man who came up with
  1535. all these cryptic commands!).
  1536.  
  1537. Here's a brief discussion of the sets enclosed and what they do:
  1538.  
  1539. 'PC to Mac PostScript' uses literals and one wildstring to clean up
  1540. PostScript files that originate on DOS machines but are being
  1541. downloaded from Macs. Torquemada automatically removes the linefeeds
  1542. (which are not a problem in any case). This set removes other
  1543. characters, common in PC-PostScript files, which _can_ be a problem
  1544. (most notably the control-D character which starts and ends many
  1545. PC-PostScript files).
  1546.  
  1547. 'Stupefaction' uses nothing but string literals and aliases to recode
  1548. Mac-like text into a form that can be used on computers less swift.
  1549. Ideally, you should reformat the output in an editor (e.g., Save As
  1550. Text Only With Linebreaks from Word). That way, those DOS pigs might
  1551. actually be able to open the file.
  1552.  
  1553. 'Reformat DOS File (Commented)' does the opposite. It takes files
  1554. that originated on DOS systems and reformats them to a fairly
  1555. Mac-like form. This set is interesting on several grounds. First, it
  1556. illustrates how to comment a TQM set: if the search string is empty,
  1557. the replace string is ignored. Consequently, you can embed
  1558. explanatory comments in your sets simply by typing them into the
  1559. replace side. Since you can run up to 32 sets in a batch, this can be
  1560. a swell idea: logically separate the types of searches you're
  1561. running, then comment each set for future reference. This file is
  1562. also making moderately interesting use of wildstrings. And finally,
  1563. the set is using markers to permit intelligent processing of special
  1564. cases.
  1565.  
  1566. This warrants its own paragraph: recall that a later search can look
  1567. for things left behind by an earlier replace. It is entirely possible
  1568. to have a problem complicated enough that you cannot fully resolve
  1569. all doubts in one search. In a case like that, you can leave markers
  1570. behind (viz., "|" or "][", anything that is unlikely to show up in
  1571. the text), then operate on them with later searches. In extreme
  1572. cases, you might need to drop in two or more markers, then operate
  1573. intelligently on the quantity present when you get around to ditching
  1574. them.
  1575.  
  1576. Or, suppose you get a file in Atari or Commodore ASCII. This seems
  1577. unlikely at this late date, but stranger things have happened. The
  1578. ASCII in those two systems was swapped: uppercase lived where
  1579. lowercase belonged, and vice versa. Presumably this was done for a
  1580. reason (to make sorting difficult?), but, whyever, it's a big problem
  1581. for you. This set will toggle the case of any file:
  1582.  
  1583. ^+        |^+
  1584.           Mark existing caps
  1585. ^-        ^C^-
  1586.           Existing lower case to ALL CAPS
  1587. |^+       ^l^+
  1588.           Marked caps to lower case
  1589.  
  1590. 'Sentence Caps' shows the first thrust at a very thorny problem.
  1591. Suppose you have a file that was typed ALL CAPS. Not all that common,
  1592. but it happens. Getting to Sentence caps is fairly easy, but in
  1593. getting there, you will have lost most of the caps on proper nouns.
  1594. Get set to run a load of literals, because that's the only way to
  1595. catch most of them. But at least one can be captured with a
  1596. generalized search, as shown in the second search in this set. This
  1597. will convert names in the form of Firstname I. Lastname back to
  1598. initial caps.
  1599.  
  1600. 'XP8 to PageMaker®' takes text processed by XP8 or Saved As XPress
  1601. Tags from Quark and puts it into a form that can be used by the Smart
  1602. ASCII filter in PageMaker. Aldus has promised a smarter Smart ASCII
  1603. filter. If you use PM, you might entreat them to hurry, because there
  1604. is a lot of cool stuff that can be done with Torquemada if there is
  1605. proper support from the destination application.
  1606.  
  1607. 'Preserve Left Column' and 'Preserve Right Column' are discussed
  1608. above.
  1609.  
  1610. 'Code Alternating Paragraphs' uses wildstrings to code any file that
  1611. comes in the form of:
  1612.  
  1613. A
  1614. B
  1615. A
  1616. B
  1617.  
  1618. Examples of this type of file: Q&A files, Officers and Directors
  1619. tables, phone or store listings, etc. The codes shown are XPress
  1620. Tags, but this would work just as well with PageMaker Smart ASCII
  1621. tags.
  1622.  
  1623. 'Code Well-Ordered File' uses wildstrings to code files that come in
  1624. the form of:
  1625.  
  1626. Head
  1627. Sub
  1628. Body
  1629. Sub
  1630. Body
  1631. Head
  1632. Body
  1633. Head
  1634. Sub
  1635. Body
  1636.  
  1637. The presumption is that headlines and subheads are preceded by
  1638. multiple returns, which is usually the case with this type of file.
  1639. Note that we are using two different body styles, since frequently
  1640. you want to omit the paragraph indent for the first paragraph after a
  1641. head.
  1642.  
  1643. And you can see the point: the judicious use of Torquemada can remove
  1644. much of the labor - and certainly the most onerous labor - from a text
  1645. processing job. In my own work, I am striving to do everything with
  1646. software, with no manual labor at all...
  1647.  
  1648.  
  1649.  
  1650. 12. Bringing It All Back Home
  1651.  
  1652. This is way awesome cool, if I do say so myself (grin).
  1653.  
  1654. My little ugly duckling has become a text-processing powerhouse.
  1655. Six-hundred-forty searches on 128 files with 29 wildthings yields a
  1656. solution to all but the most intractable text-processing problems...
  1657.  
  1658. And this is but barely the beginning! MyEditor will incorpoate
  1659. features from Torquemada, from XP8, and from some of my other
  1660. utilities to create an _environment_ for drafting, editing and
  1661. reformatting text, either interactively or in batches. Included on
  1662. this disk is a press release describing Torquemada and going into
  1663. greater detail about MyEditor. The form the Torquemada search and
  1664. replace engine will take in MyEditor will include a host of new
  1665. features, including:
  1666.  
  1667. * 100 strings in the Pyre of Purification, split up in twenty pages.
  1668. The editing area will be twice its current size. Existing sets will
  1669. be compatible, and you will still be able to load up to 32 sets in a
  1670. batch, yielding a total of 3200 strings!
  1671.  
  1672. * Multiple named sets open simultaneously, with intelligent Copy and
  1673. Paste between sets
  1674.  
  1675. * GREP-like regular expression parsing (with the existing wildcards
  1676. still supported)
  1677.  
  1678. * The size of the buffer will be limited only by allocated RAM
  1679.  
  1680. * Control over output file name and creator type
  1681.  
  1682. * Plus some other stuff (grin)...
  1683.  
  1684. In the interim, enjoy my boy Torquemada as he is today, and please do
  1685. not hesitate to contact me with any questions, suggestions or
  1686. problems.
  1687.  
  1688.  
  1689. Very Best!,
  1690.  
  1691. Greg Swann
  1692. 03/28/94
  1693.  
  1694.  
  1695.  
  1696.  
  1697. APPENDIX A - TORQUEMADA QUICK REFERENCE
  1698.  
  1699.  
  1700. ALIASES—Match special text characters
  1701.   ^T or ^t    Tab
  1702.   ^P or ^p    Carriage return
  1703.   ^^          Caret
  1704.   ^˙          ˙  ({OPT-h})
  1705.   ^˚          ˚  ({OPT-k})
  1706.  
  1707. UNTYPED WILDCARDS—Match any one character
  1708.   ^0, ^1, ^2, ^3, ^4
  1709.  
  1710. TYPED WILDCARDS—Match any one character of that type
  1711.   ^+    Uppercase character (includes accented characters)
  1712.   ^-    Lowercase character (includes accented characters)
  1713.   ^±    Character of either case (includes accented characters)
  1714.   ^&    Alphanumeric character (letter or number, not space or punctuation)
  1715.   ^%    Tabular character (digit, space or punct.; not alphabetical)
  1716.   ^$    Printable character (all characters _except_ space characters)
  1717.   ^¢    Any character _EXCEPT_ return
  1718.   ^!    Punctuation character (includes high-ASCII punctuation)
  1719.   ^.    Sentence Punctuation character (.,;:!?)
  1720.   ^#    Numeric character (digits only)
  1721.   ^_    Space character (space, return, tab, option space)
  1722.   ^¬    Space character (space, tab, option space, but _NOT_ return)
  1723.  
  1724. DO-IT-YOURSELF WILDCARD-Match any one character of the type you define
  1725.   ^«...»    "..." is your definition
  1726.  
  1727. WILDSTRINGS—Match and store any text until full pattern is matched
  1728.   ^*, ^~, ^?, ^@
  1729.  
  1730. THE WILDSTRING MODIFIER-Constrain following wildstring to type of
  1731.                         preceding wildcard or character
  1732.   ^<
  1733.  
  1734. CASE CONVERSION COMMANDS—Can be used only on the replace side;
  1735.                          accented characters are handled
  1736.                          intelligently
  1737.   ^C or ^c    CONVERT TO ALL CAPS
  1738.   ^L or ^l    convert to all lower case
  1739.   ^S or ^s    Convert to sentence caps
  1740.   ^U or ^u    Convert To Upstyle Caps
  1741.   ^D or ^d    Convert to Downstyle Caps
  1742.   ^=          Cancel all case conversion
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748. APPENDIX B - A SERMON ON TOLERATION
  1749.  
  1750.  
  1751. As I say elsewhere in this manual, Torquemada The Inquisitor owes his
  1752. name to a joke originally played by an exceptionally crafty crafter
  1753. of crossword puzzles. But, upon reflection, I've decide that I can't
  1754. make a joke of that kind without a word or two of explanation.
  1755.  
  1756. For the year 1992 marked not only the 500th anniversary of the
  1757. discovery by Columbus of the West Indies, but also the 500th
  1758. anniversary of the expulsion of the Jews from Spain by the original
  1759. Torquemada, Frey Tomás de Torquemada, Dominican friar, Inquisitor
  1760. General of The Holy Office of Spain - more popularly known as The
  1761. Spanish Inquisition.
  1762.  
  1763. The former event is being met with studied indifference punctuated by
  1764. occasional breast-beating by people who can never hope to match
  1765. Columbus in stature, either in virtue or vice. The latter event is
  1766. all but forgotten, to our peril.
  1767.  
  1768. Pity the post-modern West! What spiteful, envious, small-minded
  1769. gossips we have become. We absolve ourselves of sloth and complacency
  1770. by trying to sully every manifestation of the truly heroic we can
  1771. find. We can safely excuse ourselves of striving to the virtues of
  1772. Columbus by focusing on his vices. We can forgive ourselves for
  1773. lacking Ferdinand's courage - the courage that drove the Moorish
  1774. empire from Granada - by nattering about his bastards. We can muddle
  1775. along in the fog of the safely irresolute, with our only firm
  1776. conviction being that the conviction of Isabella - who stared down
  1777. the armed chivalry of the Spains - is "impractical". After all, she
  1778. had to pawn her jewels to fund that fool's errand of the Genoese...
  1779.  
  1780. We are a "practical" people, and we set no value above our safety,
  1781. our comfort, and our leisure. Heroes are demanding, so we have idols
  1782. instead. We demote heroes at the first sight of a flaw, thus sparing
  1783. ourselves the demands of the heroic. For our idols, anything goes,
  1784. but of our heroes we will tolerate no imperfection. The West allows
  1785. but one symbol of heroism to stand, albeit on one leg. And, of
  1786. course, he allowed his feet to be washed by a whore, a juicy tidbit
  1787. we do well to keep from Torquemada's spiritual heirs...
  1788.  
  1789. Thankfully, we are "practical" enough to have "practical" political
  1790. parties, the Gutless Socialists and the Gutless Facists, going by
  1791. different names in different nations. Thankfully, because by virtue
  1792. of their lack of both courage and conviction, they are not apt to do
  1793. anything too terribly ambitious, such as build crematoria. We have
  1794. made ourselves "practically" safe, all without having to stray too
  1795. far from the sofa and the remote control...
  1796.  
  1797. Why, we're "practically" as safe as were the Israelites in the
  1798. newly-formed nation of Spain!
  1799.  
  1800. "Reasoning by specious analogy!", we can protest, conveniently
  1801. ignoring the blood of 150 million political murders that has already
  1802. stained this century. "Demagoguery!", we can shout, neglecting the
  1803. re-enslavement of the entire globe on terms far more rapacious than
  1804. those demanded by the Romans or the Huns or the Moors or the Goths.
  1805. "But we are modern!", we can cry. Modern enough to convict Columbus
  1806. and acquit Stalin. Modern enough to mourn the slaughter of the
  1807. indigenous Americans and the Maori but to forget entirely the
  1808. slaughter of the Kulaks, of the Jews, of the Gypsies, of the Chinese,
  1809. the Koreans, the Vietnamese and the Kampucheans. We are very modern
  1810. indeed. That primitive Torquemada could only murder innocent people
  1811. one at a time...
  1812.  
  1813. In Europe, Africa and Asia, they know it _can_ happen "here". In the
  1814. United States, it's awfully easy to forget that it _has_. The vicious
  1815. practices of Senator Joseph McCarthy were taken chapter and verse
  1816. from methods perfected in the late fifteenth century by Tomás de
  1817. Torquemada - though, being ignorant, McCarthy probably borrowed them
  1818. from the Communists he was excoriating.
  1819.  
  1820. And bear in mind, while our leaders are largely gutless, their
  1821. supporters are not. Whether in the name of "Decency" or "Political
  1822. Correctness", there is never any shortage of people with the
  1823. conviction that "infidels" with unpopular ideas should not be
  1824. suffered to exist and the courage to back that conviction by force of
  1825. arms.
  1826.  
  1827. "Decency" is fine thing. So are "Political Correctness" and
  1828. "Traditional Family Values" and "Respect For Alternative Lifestyles".
  1829. All fine ideas. But when we attempt to "persuade" others of their
  1830. value with a gun - or with a law, which is the Modern Couch-Potato's
  1831. Remote Control Gun - we have left entirely the realm of civilized
  1832. discourse and entered instead the jungle of barbarism and tyranny.
  1833. What starts as rowdiness and vandalism, if unchecked, ends at an
  1834. _Auto de Fe_, at a forced march to the sea, at Treblinka...
  1835.  
  1836. Consider the irony: Torquemada killed people for refusing to renounce
  1837. their ideas in the name of a man who died rather than renounce his
  1838. ideas! I am not a Christian, but I find much to admire in the heroism
  1839. of the Nazarene. And nothing at all to admire in either Torquemada or
  1840. his So Very Modern successors. Our prized safety, our vaunted
  1841. comfort, our empty leisure - we owe these things to people who were
  1842. neither safe nor comfortable nor idle, who valued nothing ahead of
  1843. the convictions of their own minds, who feared nothing in the glare
  1844. of that bright-burning light. As we bring slander and torture and
  1845. exile and murder upon them, we bring poverty and tyranny upon
  1846. ourselves. This is the lesson that Ferdinand and Isabella learned too
  1847. late. If we cannot be _principled_, one may hope we are at least
  1848. smart enough to be "practical".
  1849.  
  1850. We would not be human if we did not seek desquite from ideas that
  1851. make us uneasy. But before we "Cry Havoc!", we would do well to see
  1852. just what kind of dogs we are unleashing. That man from Nazareth, the
  1853. last hero we suffer to stand, might be able to wash away our sins. It
  1854. seems unlikely that he can wash the blood of innocents from
  1855. Torquemada's hands. Or from our own...
  1856.  
  1857.  
  1858.  
  1859.  
  1860. APPENDIX C - BLATANT ADVERTISING
  1861.  
  1862. These are my currently shipping commercial products:
  1863.  
  1864. XP8 - a very intelligent file filter that cleans up and makes the
  1865. filthiest text QuarkXPress-ready. Among many other features, it
  1866. offers DOS-file reformatting, financial-text clean-up, garbage
  1867. disposal, typographic quality enhancement, and the best quote
  1868. conversion we know of. The ShareWare version of XP8 (v1.0.0) can be
  1869. found in CompuServe's Desktop Publishing Forum (GO DTPFORUM),
  1870. Library 5, under the name XP8.SEA. The current commercial version
  1871. is v1.0.6 and offers a great many enhancements over the ShareWare
  1872. version.
  1873.  
  1874. Torquemada The Inquisitor - batch global search and replace
  1875. software with wildcards, pattern matching, string substitution, et
  1876. very cetera. With Drag & Drop under System 7, you can run up to 640
  1877. searches on up to 128 files in one batch. Features the most
  1878. intelligent case-conversion we know of. The most-recent FreeWare
  1879. version (1.1.0) can be found under the name TORQUE.SEA in Library
  1880. 5. The current commercial version is 1.2.2, offering a great many
  1881. enhancements, including new "wildthings" and a _lot_ of new
  1882. User Interface power.
  1883.  
  1884. Shane the Plane 2.0.0 - file and font attribute editing utility.
  1885. Interactively or in Drag & Drop batches, permits you to change the
  1886. Creator/Type of files, their created/modified dates and times, a
  1887. host of significant Finder flags, plus a lot more. Makes files
  1888. invisible/visible, makes fonts behave like files by removing their
  1889. BNDL resources, batch "pastes" custom icons, intelligently renames
  1890. and/or "slugs" files, et very cetera. A demonstration version
  1891. (fully functional but limited to 32 launches) can be found in
  1892. Library 12, under the name SPDEMO.SEA.
  1893.  
  1894. Mark My Words - a very elaborate MS-Word binary to XPress Tags text
  1895. filter. It eats Word 4.0, 5.0 or 5.1 files, interactively or by
  1896. Drag & Drop, and converts the binary to QuarkXPress tagged text.
  1897. You can elect to include or omit any feature of Word's styling, and
  1898. many features can be converted from their WP-like form to their
  1899. DTP-like form (e.g., underscoring to italic). With Em Software's
  1900. Xtags Xtension, picture and text boxes (including Word's tables)
  1901. can be retained. A demonstration version (fully functional but
  1902. limited to 32 launches) can be found in Library 12, under the name
  1903. MMWDEM.SEA.
  1904.  
  1905. Bureaucrat - order-form generating software for the customers of
  1906. PostScript imaging services. Makes extensive use of Drag & Drop and
  1907. User Interfacing technology to make creating a new order form as
  1908. painless as possible for the end-user. You select the folder
  1909. containing your job and Drag & Drop it on Bureaucrat. The software
  1910. sifts through that folder and any others nested beneath it looking
  1911. for files. Each file it finds it interrogates for document,
  1912. picture, font and color information. Imaging details particular to
  1913. the job must be specified, but everything is organized to make even
  1914. this little bit of work as fast and painless as possible. The
  1915. upshot is that the "form" is 80% done after the Drag & Drop, with
  1916. the balance being quick and easy. A fully-functional specimen copy
  1917. of Bureaucrat can be found in Library 5 under the name B-CRAT.SEA.
  1918.  
  1919. (While I've vectored all the files toward CIS, my primary haunt,
  1920. they are also available on other services, and on any BBS which has
  1921. the most recent version of AMUG's BBS-In-A-Box CD-ROM on line.)
  1922.  
  1923. Bureaucrat is sold on sliding-scale terms, depending upon how much
  1924. customization is done to make your unique version. Please write to
  1925. us for a specimen copy of Bureaucrat and its full documentation.
  1926.  
  1927. Shane the Plane 2.0.0 is sold on these terms: (US)$40 each, per
  1928. license. Two to 10 licenses are $35 each, and 11 or more are $30
  1929. each.
  1930.  
  1931. Mark My Words, XP8 and Torquemada are each sold under these terms:
  1932. (US)$50 each, per license. Two to 10 licenses are $45 each, and 11
  1933. or more are $40 each. These three programs will eventually be
  1934. rolled into a stand-alone text editor cum word processor currently
  1935. in design with the working name "MyEditor". You will be entitled to
  1936. a 25% discount on the price of the MyEditor, when it is released,
  1937. for each of these utilities you have purchased and registered. In
  1938. other words, if you own XP8, your discount will be 25%. If you own
  1939. XP8 and Torquemada, it will be 50%. And if you own all three, you
  1940. will be entitled to a 75% discount. (This discount does not apply
  1941. to Shane the Plane, which is establishing its own upgrade path.)
  1942.  
  1943. If you want to buy any or all of these programs, send a check or
  1944. money order* to:
  1945.  
  1946. Greg Swann
  1947. P.O. Box 1724
  1948. Andover, MA 01810
  1949.  
  1950. or
  1951.  
  1952. 3417 North Pleasant Drive
  1953. Chandler, AZ 85224
  1954.  
  1955. *Outside the U.S., you may send cash at your own risk, if exchange
  1956. issues make that expedient.
  1957.